/*

Author   : chaos

FileName : check_error.cpp

Date     : 16/08/17 10:38:51

*/
#include <iostream>
using namespace std;

int main(int argc ,char *argv[])
{
    int i;

    cout << "Pease input a integer :" << endl;
    cin >> i ;

    cout << "good() = " << cin.good() << endl;
    cout << "eof() = " << cin.eof() << endl;
    cout<< "fail() = " << cin.fail() << endl;
    cout <<"bad() = " << cin.bad() << endl << endl;

    cin.clear();

    cout << "Reset error state ..." << endl;
    cout << "good() = " << cin.good() << endl;
    cout << "eof() = " << cin.eof() << endl;
    cout << "fail() = " << cin.fail() << endl;
    cout << "bad() = " << cin.bad() << endl;

    return 0;
}
